#include <iostream>
#include <string>
#include <memory>
#include "TcpServer.hpp"
#include "Log.hpp"
#include "HttpServer.hpp"

using std::cout;
using std::endl;
using std::string;

void Usage(string proc)
{
    cout << "Usage:\n\t " << proc << " port" << endl;
}
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(4);
    }
    int port = atoi(argv[1]);
    // TcpServer *s = TcpServer::getinstance(port);
    std::shared_ptr<HttpServer> http_server(new HttpServer(port));
    http_server->InitServer();
    http_server->Loop();
    
    return 0;
}